﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using CommunitySystemModel;
using System.Collections.ObjectModel;
using CommunitySystem.Entity;

namespace CommunitySystem.Web.Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "ISystemService" in both code and config file together.
    [ServiceContract]
    public interface ISystemService
    {
        #region 数据字典
        [OperationContract]
        int SaveDataDictionary(DataDictionaryModel DataModel, ObservableCollection<DataDictionaryItemModel> DDIM);
        [OperationContract]
        IList<DataDictionaryModel> GetDictionarys();
        /// <summary>
        /// 获取子集
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        [OperationContract]
        IList<DataDictionaryItemModel> GetDataDictionaryItem(int parentId);
        /// <summary>
        /// 获取父级
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        [OperationContract]
        IList<DataDictionaryModel> GetDataDictionary(int parentId);

        [OperationContract]
        int DeleteDataDictionary(int parentId);

        [OperationContract]
        int DeleteDataDictionaryItem(int ID);
        #endregion

        #region 用户管理
        [OperationContract]
        List<UserInfo> GetUserInfo();
        [OperationContract]
        void InsertUser(UserInfo UserInfoModel);
        [OperationContract]
        void UpdateUser(UserInfo UserInfoModel);
        [OperationContract]
        void DeleteUser(int UID);
        [OperationContract]
        UserInfo Login(string LoginName, string PassWord, string DateString, string sig, bool NeedPasswordDog);
        [OperationContract]
        int UpdatePass(string PassWord, int UID);
        [OperationContract]
        List<UserInfo> GetUserInfoByOrgNo(string OrgNo);
        #endregion 

        #region 组织机构管理
        [OperationContract]
        List<OrgInfo> GetOrgInfo();
        [OperationContract]
        void InsertOrg(OrgInfo OrgInfoModel);
        [OperationContract]
        void UpdateOrg(OrgInfo OrgInfoModel);
        [OperationContract]
        string DeleteOrg(int UID);
        #endregion

        #region 角色管理
        [OperationContract]
        List<Role> GetRole();
        [OperationContract]
        void InsertRole(Role RoleModel);
        [OperationContract]
        void UpdateRole(Role RoleModel);
        [OperationContract]
        void DeleteRole(int RID);
        #endregion

        #region 权限管理
        /// <summary>
        /// 查询某个角色的权限
        /// </summary>
        /// <param name="RoleID"></param>
        /// <returns></returns>
        [OperationContract]
        ObservableCollection<RoleMenu> GetRoleMenu(int RoleID);
        [OperationContract]
        bool UpdateRoleMenu(ObservableCollection<RoleMenu> rms);

        #endregion

        [OperationContract]
        ObservableCollection<int> GetCommunitySysteLoginTime(string loginname);

        [OperationContract]
        ObservableCollection<int> GetRegisterSysteLoginTime(string loginname);

    }
}
